package com.kiss.rpc;

import com.kiss.rpc.impl.MyDo1;

import java.util.List;


public class RpcProvider {
    public static void main(String[] args) {
        RpcBootstrap bootstrap = RpcBootstrap.getInstance();

        ServiceConfig<MyDo> serviceConfig = new ServiceConfig<>();
        serviceConfig.setInterface(MyDo.class);
        serviceConfig.setRef(new MyDo1());
        serviceConfig.setGroup("g0");

        ServiceConfig<MyDo> serviceConfig1 = new ServiceConfig<>();
        serviceConfig1.setInterface(MyDo.class);
        serviceConfig1.setRef(new MyDo1());
        serviceConfig1.setGroup("g1");

        ServiceConfig<MyDo> serviceConfig2 = new ServiceConfig<>();
        serviceConfig2.setInterface(MyDo.class);
        serviceConfig2.setRef(new MyDo1());
        serviceConfig2.setGroup("g2");

        bootstrap.publish(List.of(serviceConfig, serviceConfig2, serviceConfig1)).start();
    }

}
